# -*- coding: utf-8 -*-
# ----------------------------
# @Author:    影子
# @Software:  PyCharm
# @时间:       2025/1/22 下午5:11
# @项目:       smp_api_auto
# @FileName:  bank_card.py
# ----------------------------
"""银行卡号生成器"""
import random


class BankCard:
    """银行卡号生成器"""

    @staticmethod
    def __generate_bin():
        """随机返回银行卡相应的 BIN（前6位）"""
        bins = (
            622208, 622848, 622777, 622262, 623529, 625153, 6201361, 6201362, 6201363, 6201365, 6201366, 6201367,
            6201368,
            6201369, 6230740, 6230741, 6230742, 6230743, 6230745, 6230746, 6230747, 6230748, 6230749, 6235241, 6235242,
            6235243,
            6235244, 6235245, 6235246, 6235248, 6251640, 6251642, 6251643, 6251644, 6251645, 6251646, 6251647, 6251648,
            6251649,
            6258240, 6258241, 6258242, 6258243, 6258244, 6258245, 6258246, 6258247, 6258248, 6258249, 6230744, 6235247,
            6251641,
            6201360, 6201364, 6235240, 6235249, 620501, 6233670, 6233671, 6233672, 6233673, 6233674, 6233675, 6234340,
            6234341,
            6234342, 6234343, 6234344, 6234345, 623078, 622384, 940034, 6091201, 940015, 940008, 622379, 622886, 622391,
            940072,
            622359, 940066, 622857, 940065, 621062, 621063, 625076, 625077, 625074, 625075, 622933, 622938, 623031,
            622946,
            622942, 622994, 622583, 622584, 621016, 621015, 623187, 622950, 622951, 621060, 623551, 621072, 623630,
            621201,
            623513, 621077, 621298, 621213, 621289, 621290, 621291, 621292, 623555, 621328, 623176, 621277, 621651,
            62326516,
            623163, 623526, 623565, 623633, 623616, 623622, 623632, 622393, 6886592, 940023, 623019, 621600, 623533,
            622388,
            621267, 620043, 623063, 621664, 628360, 622695, 622865, 940012, 622178, 622179, 628358, 623131, 622394,
            940025,
            621279, 622281, 622316, 940022, 621418, 620533, 623252, 512431, 520194, 622338, 940032, 623205, 623511,
            621977,
            623112, 623578, 603445, 622467, 940016, 621463, 990027, 622325, 623029, 623105, 62326510, 622475, 621244,
            623081,
            623108, 566666, 622455, 940039, 622955, 622466, 628285, 940041, 622420, 623118, 622399, 940043, 628309,
            623151,
            603506, 622498, 622499, 940046, 623000, 623582, 622878, 623061, 623209, 62326513, 62326527, 628242, 622595,
            622303,
            622305, 621259, 622596, 622333, 940050, 621439, 623010, 940051, 628204, 622449, 623067, 622450, 621751,
            628278,
            625502, 625503, 625135, 622476, 625155, 621754, 622143, 940001, 622486, 603602, 623026, 623086, 628291,
            621532,
            621482, 622135, 622152, 622153, 622154, 622996, 622997, 940027, 940053, 622442, 623099, 628302, 623007,
            940055,
            622397, 622398, 940054, 623598, 625995, 621452, 622331, 622426, 623554, 623574, 628205, 622421, 940056,
            623531,
            96828, 628214, 625529, 625335, 622428, 621529, 622429, 621417, 623089, 623200, 622363, 940048, 621455,
            940057,
            622311, 623119, 622990, 940003, 623568, 622877, 622879, 603601, 621775, 623203, 622137, 622327, 622340,
            622366,
            9896, 622134, 940018, 623016, 623096, 940049, 622425, 621577, 62326501, 622133, 888, 622170, 621735, 622537,
            62326519, 622981, 623165, 622136, 623277, 60326500, 60326513, 622485, 622415, 940060, 623098, 628329,
            622139,
            940040, 621242, 621496, 623129, 623275, 621538, 623541, 940006, 621269, 622275, 62326522, 621359, 621216,
            622465,
            940031, 623179, 621252, 622146, 940061, 621419, 623170, 620551, 622440, 940047, 69580, 940017, 622418,
            622307,
            622162, 623146, 623077, 622413, 940002, 623188, 621237, 62249802, 94004602, 623003, 628357, 622310, 940068,
            623599,
            623670, 622321, 625001, 622427, 940069, 623039, 628273, 940070, 694301, 940071, 622368, 621446, 625901,
            622898,
            622900, 628281, 628282, 622806, 628283, 620519, 621739, 622967, 940073, 623127, 622370, 683970, 940074,
            621437,
            628319, 622400, 623177, 622308, 621415, 990871, 622126, 623166, 622132, 621340, 621341, 623073, 622140,
            622141,
            621480, 622147, 621633, 623057, 62326525, 622301, 623171, 621266, 62249804, 94004604, 621422, 628395,
            622335,
            622336, 623273, 623592, 621760, 623631, 622165, 628295, 625950, 623210, 625359, 622315, 622337, 622411,
            623102,
            622342, 623048, 622367, 622392, 623085, 622395, 622925, 622448, 623595, 622982, 621413, 622856, 623221,
            621456,
            621562, 621097, 621588, 622860, 622644, 623032, 62326503, 623518, 623216, 621037, 622870, 623150, 622866,
            622292,
            622291, 621412, 622880, 622881, 620118, 623072, 622897, 628279, 622864, 621403, 622561, 622562, 622563,
            623137,
            623264, 622167, 623193, 622777, 621497, 622532, 623197, 622888, 628398, 622868, 622899, 628255, 625988,
            622625,
            622626, 625946, 628200, 622566, 622567, 622962, 623509, 622936, 623060, 62326515, 622937, 623101, 622960,
            623523,
            623653, 621010, 622980, 623135, 628351, 621726, 621088, 620517, 622740, 625036, 621014, 621004, 623130,
            622972,
            623196, 623083, 621028, 628250, 622973, 623153, 623121, 621070, 622977, 622978, 628253, 623093, 628378,
            621200,
            623116, 621038, 623180, 621086, 621498, 621448, 621296, 628385, 621044, 622945, 621755, 622940, 623120,
            628355,
            621089, 623161, 621029, 621766, 623139, 621071, 623152, 628339, 621074, 621515, 623030, 621345, 623167,
            621090,
            623178, 621091, 623168, 621238, 628325, 621057, 623199, 628303, 621233, 623588, 621223, 621780, 628389,
            621239,
            623068, 628380, 628315, 621272, 621738, 621273, 623079, 621263, 621325, 623084, 628331, 621366, 621388,
            621348,
            620063, 623080, 621360, 623566, 621217, 622959, 622396, 622511, 621270, 623076, 625850, 628340, 621391,
            621339,
            621469, 621625, 623113, 623611, 623665, 623688, 623627, 621655, 623537, 621636, 623182, 628356, 623087,
            621696,
            623577, 621460, 622939, 621591, 622961, 622508, 623138, 621035, 621221, 623660, 621601, 6224217, 621271,
            621327,
            621337, 621748, 621235, 621075, 621753, 622441, 622979, 623037, 623160, 623505, 623623, 623621, 622478,
            940013,
            621495, 621688, 623162, 623552, 62326508, 622443, 623132, 940029, 625101, 622462, 628272, 623071, 603694,
            622323,
            9400301, 622128, 622129, 623035, 623186, 909810, 940035, 621522, 622439, 623257, 622271, 940037, 940038,
            985262,
            622322, 621017, 18572, 622369, 940042, 623190, 622412, 621523, 623055, 621013, 625889, 628254, 623276,
            940044,
            622312, 628381, 622481, 622341, 940058, 623115, 622867, 622885, 940020, 621465, 621528, 621258, 900105,
            900205,
            622319, 621521, 621690, 622320, 628375, 62231902, 90010502, 90020502, 622328, 940062, 625288, 623038,
            625888,
            622332, 940063, 623123, 622184, 621251, 621589, 623036, 621701, 622127, 622138, 621066, 621560, 621068,
            620088,
            621067, 62326520, 625186, 628336, 625526, 622531, 622329, 623103, 622339, 623539, 620500, 621024, 622289,
            622389,
            628300, 622343, 625516, 621516, 622345, 622452, 621578, 622324, 623066, 623267, 622648, 628248, 622488,
            623110,
            622858, 621058, 621527, 623091, 622288, 628280, 621537, 621736, 623540, 622686, 622855, 621461, 623521,
            622859,
            622869, 623075, 622882, 621779, 621590, 622893, 622895, 623125, 623090, 621519, 621539, 622169, 622681,
            622682,
            622683, 621592, 622991, 621585, 623013, 623059, 622358, 623025, 621021, 623501, 621566, 622506, 623027,
            623028,
            628323, 622992, 623133, 628330, 625121, 621008, 621525, 621287, 628277, 622935, 621531, 623181, 623618,
            622947,
            621561, 623095, 625150, 628326, 621526, 622953, 628387, 621536, 621036, 621458, 621517, 621065, 623017,
            623213,
            628289, 622477, 622509, 622510, 622302, 622362, 621018, 621518, 621728, 622470, 621362, 621533, 621737,
            622976,
            621033, 621099, 621457, 621459, 621530, 623201, 623256, 628297, 625097, 621061, 621520, 623065, 628332,
            621449,
            621026, 628399, 622968, 621280, 621580, 623051, 621073, 623109, 623516, 621228, 62326502, 621557, 621361,
            623033,
            623207, 621363, 622891, 623189, 623576, 623510, 625126, 628320, 621056802, 621056805, 621056801, 621056803,
            622995,
            6229756114, 622975682, 6229756115, 622975681, 62105913, 62105903, 62105916, 62105906, 62105915, 62105905,
            62105901,
            62105911, 62105900, 62105902, 621053, 621260103, 621260002, 621260001, 621275341, 621275171, 621275181,
            621275291,
            621275281, 621275111, 621275191, 621275121, 621275321, 621275221, 621275201, 621275251, 621275161,
            621275131,
            621275241, 621275271, 621275231, 621275141, 621275261, 621275101, 621275151, 621275301, 621275211,
            621275311,
            621275331, 621092007, 62109209, 621092003, 62109207, 621092002, 62109202, 621092001, 62109203, 621092008,
            62109208,
            62109211, 621092006, 62109205, 621092004, 62109212, 621092005, 62109206, 621092011, 62109214, 621092012,
            62109215,
            621092010, 62109213, 621308, 621219, 621250004, 621250006, 621250003, 621250011, 621250001, 621250012,
            621250008,
            621250010, 621250005, 621250002, 621250009, 621250007, 621241001, 622218, 628267, 62134615, 62134614,
            62134617,
            62134616, 62134605, 62134608, 62134620, 62134603, 62134604, 62134609, 62134622, 62134621, 62134602,
            62134601,
            621346003, 62134625, 62134606, 621346002, 62134618, 621346001, 621326919, 621326969, 621326979, 621326939,
            621326959, 621326929, 621326949, 621326763, 621338005, 621338008, 621338001, 621338007, 621338003,
            621338002,
            621338010, 621338006, 621338009, 621353008, 621353108, 621353113, 621353115, 621353117, 621353002,
            621353102,
            621353005, 621353105, 621353007, 621353107, 621353003, 621353103, 621353006, 621353106, 621353109,
            621353001,
            621353101, 621353110, 621353112, 621353111, 621353118, 621353119, 621353120, 621356032, 621356034,
            621356040,
            621356014, 621356038, 621356013, 621356055, 621356046, 621356044, 621356030, 621356026, 621356016,
            621356015,
            621356029, 621356047, 621356054, 621356027, 621356023, 621356005, 621356018, 621356048, 621356024,
            621356006,
            621356004, 621356003, 621356017, 621356036, 621356049, 621356025, 621356020, 621356019, 621356021,
            621356050,
            621356007, 621356009, 621356008, 621356002, 621356045, 621356062, 621356001, 621356061, 621356010,
            621356012,
            621356042, 621356011, 621356053, 621356028, 621356037, 621356052, 621356058, 621356041, 621356039,
            621356022,
            621356057, 621356031, 621356043, 621347002, 621347008, 62515901, 621347005, 621347003, 621347001, 621347101,
            621347006, 621347007, 621350010, 623589010, 623589020, 621350020, 621350431, 623589431, 623589001,
            623589451,
            621350451, 621350001, 621350013, 623589013, 623589005, 621350005, 621350009, 623589009, 621350003,
            623589003,
            621350002, 623589002, 621350015, 621350004, 623589004, 623589015, 621350006, 623589006, 621350011,
            623589011,
            621350016, 623589016, 621350007, 623589007, 621350755, 623589755, 623589017, 621350017, 621350014,
            623589014,
            621350019, 623589012, 621350012, 621350008, 623589008, 621350018, 623589019, 623589018, 621350943,
            623589943,
            621392, 621392887, 621399017, 621399008, 621399001, 621399012, 621399016, 621399015, 621399025, 621399026,
            621399023, 621399024, 621399028, 621399002, 621399018, 621399014, 621399010, 621399009, 621399011,
            621399013,
            621399003, 621399007, 621399005, 621399006, 621399021, 621399019, 621399027, 621399020, 621399022,
            621365006,
            621365001, 621365012, 621365011, 621365005, 621365007, 621365004, 621365009, 621365008, 621365003,
            621365002,
            621365010, 621401001, 62140101, 621401002, 623143003, 621481, 623143001, 623143002, 621393001, 62139383,
            621623001,
            621397001, 621397101, 621627008, 621627005, 621627002, 621627001, 621627007, 621627009, 621627003,
            621627006,
            621627010, 621635101, 621635114, 621635003, 621635103, 621635124, 621635004, 621635104, 621635112,
            621635109,
            621635111, 621635013, 621635113, 621635119, 621635010, 621635110, 621635005, 621635105, 621635007,
            621635107,
            621635118, 621635122, 621635115, 621635108, 621635117, 621635125, 621635123, 621635120, 621635106,
            621635102,
            621635116, 621650002, 621650102, 621650001, 621650101, 621630002, 621630003, 621630001, 62163113, 62163103,
            62163122, 62163119, 62163120, 62163112, 62163117, 62163114, 62163116, 62163115, 62163104, 62163118,
            62163108,
            62163107, 62163121, 62163125, 621310, 62163101, 62163123, 62163102, 62163109, 62163110, 62163111, 621637009,
            621637008, 621637006, 621637007, 621637005, 621637004, 621637001, 621637002, 621637003, 62163750, 621653002,
            621653003, 621653004, 621653005, 621653007, 621653006, 621653001, 62308299, 621628661, 621628662, 621628660,
            621316001, 62319801, 62319806, 62319802, 62319803, 621355052, 621355002, 621355051, 621355001, 621675001,
            62309702,
            62309701, 621656002, 621656003, 621396, 62165666, 621656001, 621659002, 621659001, 621659006, 621659009,
            621659008,
            621659010, 621659003, 621398001, 621676014, 621676009, 621676010, 621676001, 621676002, 621676003,
            621676006,
            621676013, 621676012, 621676011, 621676008, 621676005, 621676004, 621676015, 621676019, 621676020,
            621676018,
            621676016, 621676017, 621678105, 621678101, 621678106, 621678001, 621678002, 621678208, 621678213,
            621678207,
            621678209, 621678211, 621678212, 621678202, 621678201, 621678203, 621678205, 621678206, 621678210,
            621678215,
            621680002, 621680102, 621680007, 621680107, 621680009, 621680109, 621680010, 621680110, 621680005,
            621680105,
            621680003, 621680103, 621680004, 621680104, 621680006, 621680106, 621680008, 621680108, 621680011,
            621680111,
            621681001, 621681002, 621681003, 621682002, 621682101, 621682803, 621682102, 621682106, 621682103,
            621682105,
            621682110, 621682111, 621682109, 621682108, 621682107, 621682202, 621682201, 621682203, 621682205,
            621682209,
            621682208, 621682210, 621682213, 621682211, 621682212, 621682207, 621682206, 621682003, 621682301,
            621682302,
            621682305, 621682307, 621682306, 621682309, 621682308, 621682310, 621682303, 621682830, 621682311,
            621685701,
            621685702, 621687913, 621687001, 62169301, 62169302, 62169303, 62169502, 62169501, 62169503, 62352801,
            621697813,
            62169757, 621697793, 621697873, 62169716, 62311703, 62311702, 62311701, 62312201, 62317502, 62317501,
            621689007,
            621689001, 621689002, 621689004, 621689005, 621689006, 621689003, 621380001, 621387973, 621381001,
            621382019,
            621382018, 621382020, 621382001, 621382002, 621382006, 621382005, 621382010, 621382009, 621382007,
            621382008,
            621382003, 621382004, 621382025, 621382013, 621382017, 621382021, 621382023, 621382015, 621382016,
            621382012,
            621382014, 621382024, 621382027, 621382011, 621382022, 621382026, 62319563, 621383001, 621383002, 621385663,
            62316904, 62316905, 62316902, 62316903, 62316901, 62316906, 621265001, 62127852, 62127834, 62127843,
            621278193,
            621278293, 62127825, 621278503, 62127839, 62127823, 62127822, 62127821, 62127828, 62127820, 62127836,
            62127837,
            62127831, 62127855, 621278333, 62127810, 62127816, 62127817, 62127812, 62127815, 62127813, 62127818,
            62138402,
            62138404, 62138403, 62138401, 621384001, 621368001, 621386002, 621386001, 621386003, 621386004, 621699002,
            621699001, 621699005, 621699003, 623601001, 623604001, 623678353, 62360636, 62360637, 62360634, 62360630,
            62360632,
            62360631, 62360633, 62360635, 62360638, 62360602, 62360603, 62360629, 62360625, 62360626, 62360628,
            62360627,
            62360601, 62360620, 62360622, 62360624, 62360623, 62360621, 62360600, 62360607, 62360608, 62360605,
            62360604,
            62360606, 62360609, 62360612, 62360613, 62360610, 62360614, 62360615, 62360616, 62360611, 62360617,
            62360618,
            62360619, 623608001, 623608002, 623609001, 623609002, 62361026, 62361027, 62361025, 62361028, 623502001,
            623512001,
            623045001, 623607006, 623607008, 623607007, 623607002, 623607003, 623607004, 623607010, 623607001,
            623607005,
            623607009, 623504010, 62351501, 623504002, 623504008, 623504004, 623504009, 623504001, 623517001, 623504003,
            623504006, 623504007, 62168305, 62168301, 62168304, 62168302, 62168309, 62168308, 62168306, 62168303,
            623519533,
            62352501, 623525001, 623530953, 623532001, 62314061, 62314062, 623535002, 623535001, 623538001, 62355001,
            62355358,
            62355701, 62355702, 62355703, 623558618, 62355865, 623558611, 623558616, 623558612, 62357012, 62357009,
            62357010,
            62357006, 62357002, 62357008, 62357011, 62357007, 62357004, 62357003, 62357001, 62357005, 62359430,
            62368001,
            62368002, 62368003, 62358101, 623579001, 62358563, 623587001, 623587002, 62359065, 62361702, 62361703,
            621389,
            62359364, 62359354, 62359356, 62359350, 62359353, 62359329, 62359349, 62359351, 62144735, 62006401,
            621658001,
            62165826, 62300401, 62310402, 62310401, 62314292, 62361528, 62361527, 62361523, 62361522, 62361525,
            62361526,
            623194773, 621382076, 621382070, 621382053, 621382066, 621382063, 621382052, 621382068, 621382074,
            621382051,
            621382057, 621382058, 621382061, 621382062, 621382067, 621382060, 621382072, 621382064, 621382056,
            621382050,
            621382075, 621382073, 621382069, 621382071, 621382054, 621382065, 621382059, 621382055, 62363440, 62363441,
            62363442, 623174001, 62359602, 62359601, 62359603, 62359605, 621652853, 622372, 622365, 622471, 622943,
            622472,
            623318, 621411, 622371, 625091, 622293, 622295, 622296, 622297, 622373, 622375, 622451, 622294, 625940,
            622489,
            622871, 622958, 622963, 622957, 622798, 625010, 622487, 622490, 622491, 622492, 621744, 621745, 621746,
            621747,
            621034, 622386, 622952, 625107, 622387, 622423, 622971, 622970, 625062, 625063, 622360, 622361, 625034,
            625096,
            625098, 622406, 622407, 621442, 621443, 625026, 625024, 622376, 622378, 622377, 625092, 622409, 622410,
            621440,
            621441, 623106, 623107, 622453, 622456, 622459, 624303, 623328, 623397, 622272, 622463, 621087, 625008,
            625009,
            624337, 623413, 625055, 625040, 625042, 625044, 625046, 625048, 625053, 625058, 625060, 625136, 625172,
            625174,
            625176, 625141, 625143, 622750, 622751, 625145, 625147, 625196, 625198, 621743, 623041, 620208, 620209,
            621042,
            621783, 623308, 621742, 623042, 620206, 620207, 621043, 621784, 623310, 622493, 622547, 622548, 622546,
            620072,
            620204, 620205, 621064, 622941, 622974, 622948, 621740, 622482, 622483, 622484, 620070, 620068, 623334,
            625842,
            6258433, 6258434, 622495, 622496, 620152, 620153, 622433, 622861, 622932, 622862, 622775, 622785, 624300,
            624302,
            624308, 624309, 622920, 622434, 622436, 622435, 624407, 624408, 621232, 622432, 621247, 623043, 623064,
            624371,
            624372, 624398, 601100, 601101, 60112010, 60112011, 60112012, 60112089, 601121, 601123, 601124, 601125,
            601126,
            601127, 601128, 6011290, 6011291, 6011292, 6011293, 60112013, 6011295, 601122, 6011297, 60112980, 60112981,
            60112986, 60112987, 60112988, 60112989, 60112990, 60112991, 60112992, 60112993, 6011294, 6011296, 60112996,
            60112997, 6011300, 60113080, 60113081, 60113089, 601131, 601136, 601137, 601138, 6011390, 60112995, 6011392,
            6011393, 60113940, 60113941, 60113943, 60113944, 60113945, 60113946, 60113984, 60113985, 60113986, 60113988,
            60112994, 6011391, 601140, 601142, 601143, 601144, 601145, 601146, 601147, 601148, 601149, 601174, 60113989,
            601178,
            6011399, 601186, 601187, 601188, 601189, 644, 65, 6506, 6507, 6508, 601177, 601179, 6509, 60110, 60112,
            60113,
            60114, 60119, 621253, 621254, 621255, 625014, 625016, 622549, 622550, 623357, 624341, 6234500, 6234501,
            622354,
            623355, 621224, 622954, 62345800, 621295, 625124, 625154, 621049, 622444, 622414, 620011, 620027, 620031,
            620039,
            620103, 620106, 620120, 620123, 620125, 620220, 620278, 620812, 621006, 621011, 621012, 621020, 621023,
            621025,
            621027, 621031, 620132, 621039, 621078, 621220, 625003, 621003, 625011, 625012, 625020, 625023, 625025,
            625027,
            625031, 621032, 625039, 625078, 625079, 625103, 625106, 625006, 625112, 625120, 625123, 625125, 625127,
            625131,
            625032, 625139, 625178, 625179, 625220, 625320, 625111, 625132, 625244, 625243, 621484, 621640, 621641,
            625245,
            625246, 623379, 624344, 624424, 624446, 624346, 623395, 624373, 624374, 624384, 624420, 624380, 624404,
            624345,
            623391, 623392, 623393, 624343, 624381, 624382, 623451, 623452, 623453, 623454, 621040, 621045, 621264,
            622356,
            621234, 62349550, 62235600, 622145, 625013, 622130, 621257, 621055, 620009, 625002, 625033, 625035, 625007,
            6233710,
            6233711, 6233712, 6233720, 6233721, 6233722, 6233723, 6233730, 6233731, 6233732, 6233760, 6233761, 6233762,
            6243650,
            6243651, 6243652, 6234280, 6234290, 620015, 620024, 625004, 621344, 621349, 620108, 6216846, 6216848,
            6250386,
            6250388, 6201086, 6201088, 621354, 623326, 623327, 6234610, 6292740, 621274, 621324, 620532, 620126, 620537,
            625904,
            624313, 624333, 623358, 621645, 621624, 623332, 624338, 624351, 623339, 623370, 625104, 621647, 621642,
            624366,
            621654, 625804, 623374, 624370, 620056, 625814, 625817, 624399, 624400, 624401, 624410, 624411, 626395,
            624413,
            621649, 623316, 623317, 623315, 620079, 620091, 620105, 622164, 624357, 621657, 623024, 625840, 625841,
            624331,
            624348, 624332, 626394, 624339, 621794, 625944, 621694, 62341602, 62341601, 6233451, 6233452, 623347,
            6233453,
            6233454, 6233455, 620129, 62927300, 621301, 6214455, 6214458, 6234240, 6234241, 6234242, 624306, 624322,
            623300,
            623302, 623303, 623304, 623324, 623492, 623398, 62334910, 62334911, 62334912, 6243051, 6243052, 623307,
            623311,
            623312, 623313, 623323, 623341, 624320, 624321, 624324, 624325, 624387, 624388, 623314, 623325, 623375,
            623331,
            623348, 6243550, 6243551, 6243560, 6243561, 623336, 623337, 623338, 624323, 623360, 62335201, 62335202,
            62335203,
            623499, 62335101, 62335102, 62335103, 62335104, 62335105, 62335106, 62335107, 62335108, 6233531, 6233532,
            6233533,
            6233534, 6233535, 6233536, 6234980, 6234981, 6233537, 6233538, 6233539, 623493, 6221440, 6221441, 623359,
            623362,
            6243420, 6243421, 6243422, 6243423, 6243424, 6243425, 623369, 6233681, 624364, 624352, 624353, 624354,
            623381,
            623380, 624367, 6233780, 6233781, 6233840, 6233841, 623385, 6233820, 6233821, 6233822, 6233823, 6233824,
            623383,
            623386, 623388, 624368, 624376, 624377, 624378, 6233960, 6233961, 623389, 6234460, 6234120, 6243970,
            6234122,
            6234121, 623417, 623418, 623419, 623420, 623421, 629180, 6234090, 6243900, 6243901, 6243902, 6233990,
            6233991,
            621052, 62341401, 62341402, 62341403, 623414, 624391, 6234150, 6234151, 6234152, 6234250, 6234251, 623448,
            6234270,
            623443, 6244092, 6244096, 6234310, 62344901, 62441701, 6234320, 6234321, 6234322, 6234323, 6234330, 6234350,
            6234351, 6234352, 6234420, 62343800, 62344000, 62344001, 62441500, 62441501, 62344100, 624416, 624418,
            6292720,
            62345500, 62346000, 62346001, 622349, 622350, 622352, 622353, 622355, 622351, 620515, 920000, 921001,
            921002,
            620048, 620550, 621563, 921000, 6234390, 620038, 622265, 622266, 625972, 625973, 625093, 625095, 625165,
            625169,
            625903, 622778, 628207, 622282, 622318, 628379, 625050, 625836, 628367, 622875, 628333, 622921, 628321,
            625598,
            603367, 622286, 628236, 625800, 621777, 622813, 622818, 628228, 625166, 628359, 625163, 628341, 628270,
            628311,
            622710, 628294, 628261, 628251, 622651, 625828, 625652, 625700, 623664, 625358, 622613, 628220, 622809,
            628224,
            625119, 625577, 625952, 621752, 628213, 622533, 625167, 628345, 622416, 628263, 622718, 628305, 628361,
            628239,
            628238, 628257, 622817, 628287, 625959, 62536601, 625129, 628391, 628233, 628264, 628231, 628353, 628327,
            628275,
            622565, 622717, 622287, 628252, 628306, 628227, 623001, 628234, 621727, 623128, 628237, 628365, 628219,
            625168,
            625369, 622270, 628368, 625588, 62536602, 625090, 628293, 628373, 622611, 622722, 628211, 625500, 625989,
            625701,
            625080, 628235, 628322, 625088, 622469, 628307, 628229, 628397, 622802, 622290, 628232, 625128, 625357,
            622829,
            625819, 628301, 622808, 628308, 623088, 622815, 622816, 628226, 628223, 621416, 628217, 628284, 625820,
            628382,
            625158, 622569, 628369, 625506, 622906, 628386, 625519, 623092, 628392, 621778, 621550, 623220, 623637,
            620528,
            625152, 625156, 628271, 625886, 628328, 623423, 625829, 625943, 6243190, 6243191, 6243192, 6243193,
            62431940,
            6244220, 6244221, 6244222, 6244223, 62442240, 628377, 62134613, 62134611, 62134624, 62134626, 62134607,
            62362401,
            62441900, 62636005, 62636003, 62636004, 62636000, 62636001, 62636002, 62636006, 62636007, 62636008,
            62636009,
            62926000, 62926001, 62926002, 62926003, 62926004, 62926005, 62926006, 62926007, 62926008, 62926009,
            62926010,
            62926011, 62926012, 62926013, 62926014, 62926015, 62926016, 62926017, 62926018, 62926019, 62926020,
            62926021,
            62926022, 62926023, 62926024, 62926025, 62926026, 62926027, 62926028, 62926029, 62926030, 62926031,
            62926032,
            62926033, 62926034, 62926035, 62926036, 62926037, 62926038, 62926039, 62926900, 62926901, 62926902,
            62926903,
            62926904, 62926905, 62926906, 62926907, 62926908, 62926909, 62926910, 62926911, 62926912, 62926913,
            62926914,
            62926915, 62926916, 62926917, 62926918, 62926919, 62926920, 62926921, 62926922, 62926923, 625102, 62326531,
            625811,
            623291, 621552, 625190, 623285, 621551, 623293, 625201, 625225, 625226, 625183, 623603, 623628, 623503001,
            621260119, 621260121, 621260105, 621260117, 621260113, 621260107, 621260108, 621260106, 621260110,
            621260116,
            621260122, 621260120, 621260102, 621260118, 62109210, 621241003, 621241002, 621241004, 621346102, 62134623,
            62354331, 621356051, 621356033, 621356035, 621356056, 621347102, 621347103, 621347106, 621365013, 621365014,
            623143005, 623143004, 621650105, 621650104, 62163126, 621678103, 621678601, 621678107, 621678708, 621678709,
            621678702, 621678701, 621678703, 621678705, 621678706, 621681005, 621682801, 621682839, 621682805,
            621682808,
            621682806, 621682807, 621682812, 621682813, 621682811, 621682810, 621682809, 621682816, 621682815,
            621682817,
            621682818, 621682822, 621682821, 621682823, 621682827, 621682825, 621682826, 621682820, 621682819,
            621682802,
            621682828, 621682829, 621682831, 621682833, 621682832, 621682836, 621682835, 621682837, 621682838, 62169504,
            621381002, 62127858, 62127827, 62127877, 62138407, 62138405, 62138408, 62138406, 62138409, 62138410,
            62350801,
            623607012, 623607014, 623607015, 623607011, 623607013, 623522001, 623504005, 62352760, 62352737, 62352784,
            623530963, 623145001, 62314901, 623558615, 623558613, 62358421, 62368004, 623580001, 62358303, 62358301,
            62358302,
            62361701, 62361345, 62361346, 62364201, 623626706, 623626704, 62363585, 62361912, 62361982, 62365002,
            62354211,
            62354215, 62354213, 62365178, 62365202, 62365203, 62365204, 62365205, 62365208, 62365209, 62365206,
            62365207,
            62365504, 62365502, 62365501, 62365503, 62365506, 62365507, 62354901, 623567001, 623567002, 62367292,
            62367291,
            62134612, 62314289, 62314259, 623465, 623488, 62445400, 62927700, 623456, 623457, 624448, 624375, 624434,
            624440,
            624441, 624442, 624443, 624432, 62443100, 62443101, 6292750, 624428, 624429, 626398, 62334921, 62334923,
            62334913,
            62441901, 62348700, 6221740, 6234470, 62341407, 62341408, 62341409, 623459, 623477, 6234220, 6234300,
            6234450,
            6234451, 6234452, 6234453, 6244166, 6234440, 6234441, 6292710, 6292711, 6234670, 6234671, 6263740, 6263741,
            6292790,
            6292791, 6234620, 6234621, 6234622, 6234623, 62348100, 62348101, 62346400, 62442600, 62442601, 624423,
            624425,
            62346600, 62443000, 62443001, 62443002, 62443800, 62347600, 62444500, 62444501, 62348000, 62348001,
            62053801,
            625191, 625208, 628349, 62519301, 625195, 625157, 625192, 628276, 628243, 625189, 625992, 628354, 62134627,
            621347105, 621347107, 621678108, 621678102, 621678713, 621678711, 621678712, 621678710, 621678715, 62354290,
            625187)

        return str(random.choice(bins))

    @staticmethod
    def __calculate_luhn(card_number):
        """计算并返回 Luhn 校验位"""

        def digits_of(n):
            return [int(d) for d in str(n)]

        digits = digits_of(card_number)
        odd_digits = digits[-1::-2]
        even_digits = digits[-2::-2]
        checksum = sum(odd_digits)
        for d in even_digits:
            checksum += sum(digits_of(d * 2))
        return (10 - checksum % 10) % 10

    @staticmethod
    def generate_card_number(length=16):
        """生成指定长度的银行卡号，默认使用工商银行的通用 BIN"""
        # if len(bin_code) != 6:
        #     raise ValueError("BIN 码必须为 6 位数字!")

        # 生成中间部分的随机数字
        middle_part_length = length - 7  # 减去 BIN 和校验位
        middle_part = ''.join([str(random.randint(0, 9)) for _ in range(middle_part_length)])

        # 构建完整的卡号（不包含校验位）
        card_number_without_checksum = BankCard.__generate_bin() + middle_part

        # 计算校验位并添加到卡号末尾
        checksum_digit = BankCard.__calculate_luhn(card_number_without_checksum)
        card_number = card_number_without_checksum + str(checksum_digit)

        return card_number


def back_card():
    """对外提供银行卡号生成接口"""
    card_number = BankCard.generate_card_number()
    # print(f"{len(card_number)}位卡号：{card_number}")
    return card_number


# 测试生成函数
if __name__ == "__main__":
    print(back_card())
